﻿@model WishlistEmailAFriendModel

@using SmartStore.Web.Models.ShoppingCart;

@{
    Layout = "_Layout";

    Html.AddTitleParts(T("PageTitle.WishlistEmailAFriend").Text);
}

<div class="page email-a-friend-page">
    <div class="page-title">
        <h1>@T("Wishlist.EmailAFriend.Title")</h1>
    </div>
    <div class="page-body">
        @if (Model.SuccessfullySent)
        {
            <div class="result">
                @Model.Result
            </div>
        }
        else
        {
            using (Html.BeginForm("EmailWishlist", null, FormMethod.Post, new { @class = "form-horizontal" }))
            {
                <fieldset>
                    <p class="message-error">
						@if (!ViewData.ModelState.IsValid)
						{
							@Html.ValidationSummary(true)
						}
                    </p>
                
                    <div class="form-group">
                        @Html.LabelFor(model => model.FriendEmail, new { @for = "FriendEmail", @class = "col-form-label required" })
                        @Html.TextBoxFor(model => model.FriendEmail, new { @class = "friend-email form-control", placeholder = T("Wishlist.EmailAFriend.FriendEmail.Hint") })
                        @Html.ValidationMessageFor(model => model.FriendEmail)
                    </div>

                    <div class="form-group">
                        @Html.LabelFor(model => model.YourEmailAddress, new { @for = "YourEmailAddress", @class = "col-form-label required" })
                        @Html.TextBoxFor(model => model.YourEmailAddress, new { @class = "your-email form-control", placeholder = T("Wishlist.EmailAFriend.YourEmailAddress.Hint") })
                        @Html.ValidationMessageFor(model => model.YourEmailAddress)
                    </div>

                    <div class="form-group">
                        @Html.LabelFor(model => model.PersonalMessage, new { @for = "PersonalMessage", @class = "col-form-label" })
                        @Html.TextAreaFor(model => model.PersonalMessage, new { @class = "personal-message form-control", placeholder = T("Wishlist.EmailAFriend.PersonalMessage.Hint") })
                        @Html.ValidationMessageFor(model => model.PersonalMessage)
                    </div>

                    <div class="form-group row">
                        <div class="col-12 text-muted">
                            @T("Common.FormFields.Required.Hint")
                        </div>
                    </div>

					@{ Html.RenderWidget("gdpr_consent"); }

                    @if (Model.DisplayCaptcha)
                    {
						<div class="form-group">
							<div class="captcha-box">
								@Html.Raw(Html.GenerateCaptcha())
							</div>
						</div>
                    }
                
                    <input type="hidden" name="send-email" value="send-email">

                    <div class="form-group">
                        <button type="submit" name="send-email" class="btn btn-primary send-email-a-friend-button">@T("Wishlist.EmailAFriend.Button")</button>
                    </div>

                </fieldset>
            }
        }
    </div>
</div>
